import static org.junit.Assert.*; 
import java.io.IOException;
import java.util.List;
import java.util.Set;

import org.junit.Test;

import com.lsz.word.util.Directory;
import com.lsz.word.util.Words;


public class TestDirectory {

	@Test
	public void test() throws IOException {
		long t1  =  System.currentTimeMillis();
		List<String> wordlist = Words.words("big.txt");// 获取该文件中全部的
		List<String> lowWordList = Words.allToLow(wordlist);//将列表中的单词全部转换为小写
		
		long t2 = System.currentTimeMillis();
	
		System.out.println("词汇列表的时间花了-----"+(t2-t1)+"ms");
		
		Directory directory  = Directory.getInstance(lowWordList);
	
		long t3 = System.currentTimeMillis();
		
		System.out.println("加载字典花了-----"+(t3-t2)+"ms");
		
		
		Set<String> keyset = directory.keySet();
		for(String key:keyset){
				System.out.print(key);
				System.out.println("-------------"+directory.get(key));
		}
	}

}
